class MyClass extends Object {}

let x2 = new MyClass
console.log(typeof MyClass) // function

// 接口是对象的表现，数据是类型的表现

// User1 是一个类型别名, 这个类型是: 1.字面量对象类型, 2.匿名的接口类型
type User1 = {
    id: number,
    name: string,
    age: number
}

// User2 是一个接口
interface User2 {
    id: number,
    name: string,
    age: number
}

class MyClass2 implements User2 {
    id: number = 0;
    name: string = '';
    age: number = 0;
}

let a1: User2 = new MyClass2()
let a2: User1 = {
    id: 0,
    name: '',
    age: 0
}
let a3: User1 = a1
a2 = a1